from pymodbus.client.sync import ModbusTcpClient
import time


client = ModbusTcpClient('192.168.0.181', port=502,timeout=5)

while True:
    request = client.read_holding_registers(0,2)
    result = request.registers
    print(result)
    print(result[0])
    time.sleep(1)

client.close()